<%@ Control Language="C#" AutoEventWireup="true" Codebehind="NavPanel.ascx.cs" Inherits="Portal.Administrator.UserControls.NavPanel" %>
<script type="text/javascript">
    var curr_menu = '';
    function OnClick(id) { 
        if(curr_menu && curr_menu != '' && curr_menu != id)
            document.getElementById(curr_menu).style.display = 'none';
        
        curr_menu = id;
        
        if (document.getElementById(id).style.display == "block" ) {
            document.getElementById(id).style.display = "none";
            Global.set_cookie('curr_admin_menu', '');
        } else {                        
            document.getElementById(id).style.display = "block";
            Global.set_cookie('curr_admin_menu', id)
        }
    }
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
    <tr>
        <th scope="col">
            <img src="/Administrator/Images/n_top_left_mn.jpg" width="200" height="34" /></th>
    </tr>
    <tr>
        <th background="/images/HomePage/n_bg_left_mn.jpg" scope="col">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" id="masterdivAdmin">
            <tbody>
                <%
                    for (int i = 0; i < this.nodelist.Count; i++)
                    {
                %>
                <tr onclick ="OnClick('cmd<% = i %>');">
                    <th height="27" scope="col"><img height="1" src="/Administrator/Images/blank.gif" width="12" /><img src="/Administrator/Images/n_icon_mn.gif" width="12" height="5" />
                        <a href="<% = this.nodelist[i].NavigateUrl %>" class="text2">
                           <strong> <% = this.nodelist[i].Text.ToUpper()%></strong>
                        </a>
                    </th>
                </tr>
                <tr>
                    <th scope="col">
                    </th>
                    <th background="/Administrator/Images/line1.gif" scope="col">
                        <img height="1" src="/Administrator/Images/blank.gif" width="1" /></th>
                    <th scope="col">
                    </th>
                </tr>
                <tr id = "cmd<% = i %>" style="display:none;" >
                <td colspan ="2">
                  
                 <%
                    this.Response.Write(this.CreateMenuString(this.nodelist[i], 0));
                }
                %>
                </td>
                </tr>
               </tbody>
            </table>
        </th>
    </tr>
    <tr>
        <th scope="col">
            <img height="34" src="/Administrator/Images/n_bottom_left_mn.jpg" width="200" /></th>
    </tr>
</table>
<script type="text/javascript">
    var curr_menu = Global.fetch_cookie('curr_admin_menu');
    if(curr_menu && curr_menu.length > 0 && document.getElementById(curr_menu))
    {
        document.getElementById(curr_menu).style.display = 'block';
    }else{
        curr_menu = '';
    }
</script>